package com.whiteblue.validator;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

/**
 * Created by WhiteBlue on 15/4/6.
 */
public class PostValidator extends Validator{

    @Override
    protected void validate(Controller controller) {
        this.validateString("content", true, 1, 200, "msg", "内容有误");
        this.validateLong("book", "msg", "输入有误");
    }

    @Override
    protected void handleError(Controller controller) {
        controller.render("/info.html");
    }
}
